<!DOCTYPE html>
<!-- saved from url=(0034)http://profile.mengma.com/settings -->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh" lang="zh-CN" class=" " style="overflow-y: hidden;"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta http-equiv="x-dns-prefetch-control" content="on">
	<meta name="renderer" content="webkit">
	<title>设置 - 萌码</title>
	<meta name="author" content="Mengma">
	<meta name="description" content="萌码是计算教育领域的先行者，领先的跟随式教学、图形化教学等让计算学习更有趣、更高效。萌码和杰出的人一同前行，让人们享受最好的教育。">
	<meta name="keywords" content="萌码,教育,在线教育,在线编程教育,跟随式,图形化,编程,计算,代码,猛犸">
	<meta name="viewport" content="width=device-width,initial-scale=1">
	<meta property="og:type" content="website">
	<meta property="og:title" content="">
	<meta property="og:url" content="http://profile.mengma.com/settings">
	<meta property="og:description" content="萌码是计算教育领域的先行者，领先的跟随式教学、图形化教学等让计算学习更有趣、更高效。萌码和杰出的人一同前行，让人们享受最好的教育。">
	<meta property="og:site_name" content="萌码">
	<meta property="og:image" content="http://s.mengma.com/img/mm_logo.png">
	<link rel="canonical" href="http://profile.mengma.com/settings">
	<link rel="shortcut icon" type="image/x-icon" href="http://profile.mengma.com/favicon.ico">
	<link rel="icon" type="image/png" href="http://s.mengma.com/img/mm_icon.png">
	<link rel="dns-prefetch" href="http://www.mengma.com/">
	<link rel="dns-prefetch" href="http://passport.mengma.com/">
	<link rel="dns-prefetch" href="http://profile.mengma.com/">
	<link rel="dns-prefetch" href="http://ask.mengma.com/">
	<link rel="dns-prefetch" href="http://s.mengma.com/">
	<link rel="dns-prefetch" href="http://www.google-analytics.com/">
	<link rel="stylesheet" type="text/css" href="./shezhi/bootstrap.min_385b96--.css">
	<link rel="stylesheet" type="text/css" href="./shezhi/font-awesome.min_234f99--.css">
	<link rel="stylesheet" type="text/css" href="./shezhi/nprogress_712236--.css">
	<link rel="stylesheet" type="text/css" href="./shezhi/mm_common_dc4502--.css">
	<link rel="stylesheet" type="text/css" href="./shezhi/mm_crop_2cd8f9--.css">
	<link rel="stylesheet" type="text/css" href="./shezhi/simplePagination_7f6ea9--.css">
	<!--[if lt IE 9]><script type="text/javascript" src="http://s.mengma.com/js/html5shiv.min_2536f8--.js"></script><script type="text/javascript" src="http://s.mengma.com/js/respond.min_9cccbc--.js"></script><![endif]-->
	<script src="./shezhi/hm.js"></script><script type="text/javascript" src="./shezhi/markdown.min_6eecac--.js"></script>
<link rel="stylesheet" type="text/css" href="./shezhi/mm_settings.v3.2_1c0392--.css">
</head>
<body>
	<div class="mm_wrapper">
		<nav class="mm_navbar navbar navbar-default navbar-fixed-top navbar-fixed-top-1" role="navigation">		
<!-- 			<div class="header_email">
				<p>大神，你还没有激活你的邮箱哦~<a href="http://profile.mengma.com/settings?type=3"  data-id="1" id="mm_email_setting">
				立即去激活</a>~
				</p>
			</div> -->

			<div class="container">
				<div class="navbar-header">
					<a href="http://www.mengma.com/" class="mm_navbar_brand">
						<img src="./shezhi/logo.svg" class="mm_navbar_brand_logo">
					</a>					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mm_navbar_collapse">
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
						<span class="icon-bar"></span>
					</button>
				</div>
				<div id="mm_navbar_collapse" class="collapse navbar-collapse">
					<ul class="nav navbar-nav navbar-right mm_navbar_nav">
						<li class="navbar_slide_li">
							<a href="http://www.mengma.com/volumes" data-type="0">
								<span><img src="./shezhi/mm_gray_0.svg" alt="课程" class="mm_icon_qa"> 课程</span>
							</a>						</li>
						<li class="navbar_slide_li">
							<a href="http://oj.mengma.com/" data-type="1">
								<span><img src="./shezhi/mm_gray_1.svg" alt="" class="mm_icon_oj"> 实战</span>
							</a>
						</li>
						<li class="navbar_slide_li">
							<a href="http://qa.mengma.com/" data-type="2">
								<span><img src="./shezhi/mm_gray_2.svg" alt="问答" class="mm_icon_oj"> 问答</span>
							</a>
						</li>
<li class="dropdown mm_user" id="mm_dropdown_toggle">
								<input type="hidden" value="" id="userNameInput">
								<input type="hidden" value="152441362094156709" id="userId">
								<a href="javascript:void(0)" class="dropdown-toggle" data-type="5" data-toggle="dropdown">
									<span>
										<img src="./shezhi/woman_20.png" class="mm_avatarNavBar">
										<span class="mm_notify_badge" id="mm_notify_badge" style=""></span>
									</span>
									<span class="mm_user_name">萌小码209...</span>
								</a>
								<ul class="dropdown-menu mm_dropdown_menu mm_notify_dropdown_menu" id="mm_notify_menu" role="menu">
									<li id="mm_notify_ask"></li>
									<li id="mm_notify_sys"></li>
								</ul>
								<ul class="dropdown-menu mm_dropdown_menu mm_navbar_dropdown_menu" role="menu">
									<li>
										<a href="http://profile.mengma.com/user/152441362094156709">
											<img src="./shezhi/mm_home.png" class="mm_icon_left">
											个人中心
										</a>
									</li>
									<li class="divider"></li>
									<li>
										<a href="http://profile.mengma.com/settings">
											<img src="./shezhi/mm_setting.png" class="mm_icon_left">
											设置
										</a>
									</li>
									<li class="divider"></li>
									<li>
										<a href="http://passport.mengma.com/logout/">
											<img src="./shezhi/mm_layout.png" class="mm_icon_left">
											退出
										</a>
									</li>
								</ul>
							</li>
					</ul>
				</div>
			</div>
		</nav>

		<div class="mm_top">
			<!--[if lt IE 9]><div class="mm_error">您的浏览器版本过旧，为了正常地访问网站，我们推荐您使用 <a target="_blank" href="http://www.google.cn/chrome/">Google Chrome</a> 浏览器。</div><![endif]-->
		</div>
		<div class="mm_middle">
			<div class="container">
				<div class="row mm_margin_t_10">
					<div class="col-md-3 mm_padding_r_10">
						<ul class="mm_cog_l_list">
							<li data-id="0" class="mm_cog_list_active">个人资料</li>
<li data-id="1">密码设置</li>							<li data-id="2">邮箱设置</li>
						</ul>
					</div>
					<div class="col-md-9">
						<div id="mm_personal_data" class="mm_cog_item mm_cog_active">
							<div class="mm_cog_right">
								<h2 class="mm_cog_title">个人资料</h2>
								<div id="mm_cog_personal" class="mm_cog_personal">
									<div class="row">
										<div class="col-md-offset-1 col-md-1">头&nbsp;&nbsp;&nbsp;像</div>
										<div class="col-md-8">
											<img src="./shezhi/woman_100.png" class="mm_avatar_big" data-toggle="modal" data-target="#mmModal">
											<p id="avater_Explain" style="visibility:hidden;" class="mm_margin_0">点击更换头像</p>
										</div>
									</div>
									<div class="row">
										<div class="col-md-offset-1 col-md-1">用&nbsp;户&nbsp;名</div>
										<div class="col-md-8">萌小码152441362094156709</div>
									</div>

									<div class="row">
										<div class="col-md-offset-1 col-md-1">邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱</div>

										<div class="col-md-8 mm_user_email">yongrui2404@sina.com											</div>		
									</div>
									<div class="row">
										<div class="col-md-offset-1 col-md-1">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</div>
										<div id="mm_cog_sex" class="col-md-8" data-sex="0">女</div>
									</div>
									<div class="row">
										<div class="col-md-offset-1 col-md-1">生&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日</div>
										<div id="mm_cog_birth" class="col-md-8" data-birth="">少侠，年方几何？</div>
									</div>
									<div class="row">
										<div class="col-md-offset-1 col-md-1">所在城市</div>
										<div id="mm_cog_province" class="col-md-8" data-p=" ">何方神圣？</div>
									</div>
									<div class="row">
										<div class="col-md-offset-1 col-md-1">所在大学</div>
										<div id="mm_cog_college" class="col-md-8">
萌码大学
										</div>
									</div>
									<div class="row">
										<div class="col-md-offset-1 col-md-1">个人签名</div>
										<div class="col-md-8 align_wrap">
学前留名表个决心吧！
										</div>
									</div>
									<div class="row mm_margin_38">
										<a id="mm_personal_modify" href="javascript:void(0);" class="btn mm_cog_personal_modify">修改资料</a>
									</div>
								</div>
								<div id="mm_cog_personal_modify" class="mm_cog_personal" style="display:none;">
									<div class="row">
										<div id="mm_personal_tip" class="col-md-offset-2 col-md-8" style="color:#fd0216;display:none;"></div>
									</div>
									<div class="row">
										<div class="col-md-offset-1 col-md-1">用&nbsp;户&nbsp;名</div>
										<div class="col-md-8"><input id="mm_modi_username" type="text" value="" class="form-control" maxlength="7"></div>
									</div>
									<div class="row mm_margin_t_20">
										<div class="col-md-offset-1 col-md-1">性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别</div>
										<div class="col-md-8">
											<select class="form-control" id="mm_modi_sex">
												<option>男</option>
												<option>女</option>
											</select>
										</div>
									</div>
									<div class="row mm_margin_t_20">
										<div class="col-md-offset-1 col-md-1">生&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日</div>
										<div class="col-md-8"><input type="text" id="mm_modi_birthday" class="form-control mm_cog_personal_birth" name="birthday" placeholder="出生日期" value=""></div>
									</div>
									<div class="row mm_margin_t_20">
										<div class="col-md-offset-1 col-md-1">所在城市</div>
										<div class="col-md-8">
											<select id="mm_cog_pro" name="pro" class="form-control mm_cog_pro" data-p="" data-city="">
												<option>- 请选择 -</option>
												<option>北京市</option>
												<option>上海市</option>
												<option>天津市</option>
												<option>重庆市</option>
												<option>河北省</option>
												<option>山西省</option>
												<option>内蒙古自治区</option>
												<option>辽宁省</option>
												<option>吉林省</option>
												<option>黑龙江省</option>
												<option>江苏省</option>
												<option>浙江省</option>
												<option>安徽省</option>
												<option>福建省</option>
												<option>江西省</option>
												<option>山东省</option>
												<option>河南省</option>
												<option>湖北省</option>
												<option>湖南省</option>
												<option>广东省</option>
												<option>广西壮族自治区</option>
												<option>海南省</option>
												<option>四川省</option>
												<option>贵州省</option>
												<option>云南省</option>
												<option>西藏自治区</option>
												<option>陕西省</option>
												<option>甘肃省</option>
												<option>宁夏回族自治区</option>
												<option>青海省</option>
												<option>新疆维吾尔族自治区</option>
												<option>香港特别行政区</option>
												<option>澳门特别行政区</option>
												<option>台湾省</option>
												<option>其它</option>
											</select>
											<select id="mm_cog_city" name="city" class="form-control mm_cog_city">
												<option>城市</option>
											</select>
										</div>
									</div>
									<div class="row mm_margin_t_20">
										<div class="col-md-offset-1 col-md-1">所在大学</div>
										<div class="col-md-8"><input id="mm_modi_college" type="text" value="" class="form-control" maxlength="50"></div>
									</div>
									<div class="row mm_margin_t_20">
										<div class="col-md-offset-1 col-md-1">个人签名</div>
										<div class="col-md-8">
											<textarea id="mm_modi_des" class="form-control" data-des="" rows="5" style="resize: none; overflow-y: hidden; outline: none;" maxlength="70" tabindex="0"></textarea>
										</div>
									</div>
									<div class="row mm_margin_140">
										<a id="mm_personal_cancel" href="javascript:void(0);" class="btn mm_cog_personal_cancel">取消</a>
										<a id="mm_personal_save" href="javascript:void(0);" class="btn mm_cog_personal_modify">保存修改</a>
									</div>
								</div>
							</div>
						</div>

						<div id="mm_personal_data" class="mm_cog_item">
							<div id="mm_safe_setting" class="mm_cog_right">
								<h2 class="mm_cog_title" data-b="1">密码设置</h2>
<div id="mm_land_unthird" class="mm_cog_safe">
									<div class="row">
										<div id="mm_pwd_tip" class="col-md-offset-2 col-md-7" style="color:#fd0216;color:#fd0216;height:20px;line-height:22px;"></div>
									</div>
									<div class="row">
										<div class="col-md-offset-1 col-md-1">原密码</div>
										<div class="col-md-7"><input id="mm_old_pwd" type="password" class="form-control" maxlength="20"></div>
									</div>
									<div class="row mm_margin_t_20">
										<div class="col-md-offset-1 col-md-1">新密码</div>
										<div class="col-md-7"><input id="mm_new_pwd_unth" type="password" class="form-control" placeholder="密码长度为6~20个字符，必须包含英文字母" maxlength="20"></div>
									</div>
									<div class="row mm_margin_t_20">
										<div class="col-md-offset-1 col-md-1">确认密码</div>
										<div class="col-md-7"><input id="mm_renew_pwd_unth" type="password" class="form-control" placeholder="密码长度为6~20个字符，必须包含英文字母" maxlength="20"></div>
									</div>
									<div class="row mm_margin_140">
										<a id="mm_pwd_save" href="javascript:void(0);" class="btn mm_cog_personal_modify">保存修改</a>
									</div>
								</div>			
							</div>
						</div>
						<!-- 邮箱设置 -->
						<div class="mm_cog_item">
							<div id="mm_email_setting" class="mm_email_setting mm_cog_right">
		<!-- $isVerify ueq 0 -->
										<!--  绑定邮箱已验证  -->
								<div id="mm_cog_email_verify" class="mm_cog_email" style="">
									<div class="mm_email_verfing">
										<p style="height:110px;color:#b5b6b7;font-size:70px;line-height:120px;">
											:) 
										</p>
										<p style="color:#11364c;margin-bottom:3px;">
											您的邮箱已经激活
										</p>
										<p style="color:#11364c;" id="cur_email">yongrui2404@sina.com</p>
									</div>
								</div>							</div>						</div>
					</div>
				</div>
			</div>

			<div class="modal fade" id="mmModal" tabindex="-1" role="dialog" aria-labelledby="mmModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only">关闭</span>
							</button>
							<h4 class="modal-title" id="mmModalLabel">更换头像</h4>
						</div>
						<div class="modal-body">
							<div class="container-fluid">
								<div class="row">
									<div class="row col-xs-12">
										<p class="col-xs-12">上传清晰美观的个人头像，给别人留下美好的第一印象
											<br> 1. 支持JPEG、GIF、PNG格式
											<br> 2. 单张图片在2M以内
										</p>
									</div>
									<div class="row" style="margin-top:10px;">
										<div class="col-xs-8">
											<div class="row">
												<div id="imageBox" class="col-xs-12">
													<div class="imageBox" style="background-color:#f5f5f6;border-color:#f5f5f6;">
														<!-- <div class="spinner" style="display: none">载入</div> -->
													</div>
												</div>
												
											</div>
											<div class="row col-xs-12" style="margin-top:5px;">
												<div class="col-xs-12">
													<form action="http://profile.mengma.com/settings" method="post" enctype="multipart/form-data" id="uploadForm">
														<input type="file" name="fileField" id="fileField" style="display:none;"></form>
														<div class="row" style="margin-top:5px;">
															<div class="col-xs-2">
																<input type="button" class="btn btn-default btn-block btn-large btn_zoom" id="btnZoomOut" value="-">
															</div>
															<div class="col-xs-8" style="padding:0;position:relative;">
																<div class="mm_slider_mask"></div>
																<div id="slider" style="z-index:1;"></div>
															</div>
															<div class="col-xs-2" style="padding-left:22px;">
																<input type="button" class="btn btn-default btn-block btn-large btn_zoom" id="btnZoomIn" value="+">
															</div>
														</div>
														<div class="row" style="margin-top:5px;">
															<div class="col-xs-12">
																<input id="upload_avatar" type="button" class="btn btn-warning btn-large btn-block mm_choose_img" value="从电脑上选取照片">
															</div>
														</div>
														<div class="row" style="margin-top:5px;">
															<div class="col-xs-4" style="padding-right:0;">
																<button type="button" class="btn btn-block btn-large mm_cancle_avatar" id="cancel_avatar">取消</button>
															</div>
															<div class="col-xs-8" style="padding-right:10px;">
																<button type="button" class="btn btn-block btn-large" style="color:#fff;" id="save_avatar">提交,完成</button>
															</div>
														</div>
													
												</div>
											</div>
										</div>
										<div class="col-xs-3">
											<div class="row" style="text-align:center">
												头像预览
											</div>
											<div id="mm_avatar_big" class="row" style="margin-top:30px;">
												<div class="mm_avatar_big mm_cog_center" id="avatar_big"></div>
											</div>
											<div class="row" style="margin-top:30px;">
												<div class="mm_avatar_middle mm_cog_center" id="avatar_middle"></div>
											</div>
											<div class="row" style="margin-top:30px;">
												<div class="mm_avatar_small mm_cog_center" id="avatar_small"></div>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="mm_bottom">
			<div class="container">
				<div class="hidden-xs mm_meta">
					<a href="http://www.mengma.com/about/#mm_about_us" target="_blank">关于我们</a>
					<a href="http://www.mengma.com/about/#mm_media_reports" target="_blank">媒体报道</a>
					<a href="http://www.mengma.com/about/#mm_link" target="_blank">友情链接</a>
					<a href="http://www.mengma.com/about/#mm_recruitment" target="_blank">人才招聘</a>
					<a href="http://www.mengma.com/about/#mm_contact_us" target="_blank">联系我们</a>
					<a href="http://www.mengma.com/about/#mm_feedback" target="_blank">意见反馈</a>
					<a href="http://www.mengma.com/about/#mm_service" target="_blank">服务条款</a>
				</div>
				<div class="mm_social">
					<img src="./shezhi/qr_wechat.png">
				</div>
				<div class="mm_social">
					<a href="http://weibo.com/mengmacom" target="_blank"><img src="./shezhi/i_weibo.png" class="mm_footer_social_icon"></a>
					<a href="javascript:void(0)" onclick="$(&#39;.mm_social&gt;img&#39;).show()"><img src="./shezhi/i_wechat.png" class="mm_footer_social_icon"></a>
					<a href="http://tieba.baidu.com/f?kw=%E8%90%8C%E7%A0%81" target="_blank"><img src="./shezhi/i_tieba.png" class="mm_footer_social_icon"></a>
				</div>
				<div class="text-center mm_copyright">
					<div>
					<img src="./shezhi/mm_logo.png" style="margin-right:18px;">Copyright  ©  2015 MengMa.com. All Rights Reserved. 京ICP备14043944号.</div>
				</div>
			</div>
		</div>
	</div>

<script type="text/javascript" src="./shezhi/common.min_e424ea--.js"></script>
<script type="text/javascript" src="./shezhi/bootstrap.min_7b82cf--.js"></script>
<script type="text/javascript" src="./shezhi/mm_common_018fd9--.js"></script><script src="./shezhi/h.js" type="text/javascript"></script><div id="ascrail2000" class="nicescroll-rails nicescroll-rails-vr" style="width: 8px; z-index: 99; cursor: default; position: fixed; top: 0px; height: 100%; right: 0px; opacity: 0; display: block;"><div class="nicescroll-cursors" style="position: relative; top: 52px; float: right; width: 8px; height: 372px; border-radius: 5px; background-color: rgb(122, 119, 119); background-clip: padding-box;"></div></div><div id="ascrail2001" class="nicescroll-rails nicescroll-rails-vr" style="width: 8px; z-index: auto; cursor: default; position: absolute; top: 1px; left: 91px; height: 0px; display: none;"><div class="nicescroll-cursors" style="position: relative; top: 0px; float: right; width: 8px; height: 0px; border-radius: 5px; background-color: rgb(122, 119, 119); background-clip: padding-box;"></div></div>
<script type="text/javascript" src="./shezhi/mm_settings.v3.2_bce184--.js"></script>
<script type="text/javascript" src="./shezhi/cropbox_0ef327--.js"></script>
<script type="text/javascript" src="./shezhi/slider-min_bf7b15--.js"></script>
<script type="text/javascript">

$(function() {
	/**  AVATAR UPLOAD  **/
	var _sliderValue;
	var _sliderCreate = true;
	var avatarSrc;

	$("#mmModal").on("shown.bs.modal", function() {
		$(".thumbBox").width(198).height(198);
		$("#upload_avatar").css("margin-left","2px");
		$("#upload_avatar").css("display","block");
		if(_sliderCreate) {
			winSlider.create();
			winSlider.setValue(0);
			_sliderCreate = false;
		}
	});
	$("#fileField").change(function(e) {
		if ("undefined" === typeof FileReader) {  
			alert('天啊！您的浏览器不支持HTML5~- -#，无法使用头像上传系统，赶紧升级到更新、更棒的浏览器吧.');
			return;
		}		
		var reader = new FileReader();
		reader.onload = function(e) {
			window.cropper = {};
			avatarSrc = this.result;
			var options = {
				thumbBox: '.thumbBox',
				spinner: '.spinner',
				imgSrc: this.result,
				cb: cropit,
				winSlider:winSlider,
			};
			window.cropper = $('.imageBox').cropbox(options);
		}
		reader.readAsDataURL(e.target.files[0]);
		$('.imageBox').bind('mousewheel DOMMouseScroll',function(e) {
			cropit();
			if(e.originalEvent.wheelDelta > 0) {
				$('#btnZoomIn').click();
			} else {
				$('#btnZoomOut').click();
			}
		});
		$('.imageBox').bind('mouseup', cropit);
		$('#avatar_big').css("display","block");
		$('#avatar_middle').css("display","block");
		$('#avatar_small').css("display","block");
		$("#upload_avatar").css("display","none");
		$("#save_avatar").addClass("btn-success");
		$(".imageBox").html('<div class="thumbBox"></div>');
		$("#btnZoomIn").css("background-color","#ffa84b");
		$("#btnZoomOut").css("background-color","rgb(230, 230, 230)");
	});
	$("#upload_avatar").click(function() {
		$("#fileField").trigger("click");
	});
	$(".mm_avatar_big").on("mouseenter", function() {
		$("#avater_Explain").css("visibility", "visible");
	}).on("mouseleave", function() {
		$("#avater_Explain").css("visibility", "hidden");
	});
	$("#save_avatar").click(function() {
		var imgData = cropper.getDataURL();
		$.ajax({
			url: '/settings/cropavatar',
			type: 'POST',

			data: {
				src: avatarSrc,
				cropW: $(".thumbBox").height(),
				cropH: $(".thumbBox").height(),
				cropX: imgData[0],
				cropY: imgData[1],
				picWidth: imgData[2],
				picHeight: imgData[3],
				ratio: imgData[6]
			},
			dataType: 'json',
		}).always(function(data) {
			if (data.code == '0') {
				$("#mmModal").modal("hide");
				$("#mmModal").on("hidden.bs.modal", function() {
					Phenix.init({
						width: 500,
						height: 300,
						template: "<div style=\"color:{{color}};\" class=\"mm_temp_face\">{{face}}</div><div class=\"mm_temp_title\">{{title}}</div>",
						data: {
							color: "#36b14a",
							face: ":)",
							title: "恭喜您！已经上传成功！",
						}
					}).show(function() {
						setTimeout(function() {window.location.reload();},3000);
					});
				});
			}
		});
	});
	$("#cancel_avatar").click(function() {
		$("#mmModal").modal("hide");
	});
	$("#mmModal").on("hidden.bs.modal", function() {
		$("#fileField").val("");
		$("#imageBox").html('<div class="imageBox" style="background-color:#f5f5f6;border-color:#f5f5f6;"></div>');
		$('#avatar_big').css("display","none");
		$('#avatar_middle').css("display","none");
		$('#avatar_small').css("display","none");
		window.cropper = {};
	});
	
	function cropit() {
		if (window.hasOwnProperty("cropper")) {
			if(cropper != undefined) {
				var imgData = cropper.getDataURL();
				$('#avatar_big').css({
					'background-image': 'url(' + cropper.image.src + ')',
					'background-size': (imgData[2] / ($(".thumbBox").height() / 100)) + 'px ' + (imgData[3] / ($(".thumbBox").height() / 100)) + 'px',
					'background-position': (imgData[0] / ($(".thumbBox").height() / 100)) + 'px ' + (imgData[1] / ($(".thumbBox").height() / 100)) + 'px',
					'background-repeat': 'no-repeat'
				});
				$('#avatar_middle').css({
					'background-image': 'url(' + cropper.image.src + ')',
					'background-size': (imgData[2] / ($(".thumbBox").height() / 100 * 2)) + 'px ' + (imgData[3] / ($(".thumbBox").height() / 100 * 2)) + 'px',
					'background-position': (imgData[0] / ($(".thumbBox").height() / 100 * 2)) + 'px ' + (imgData[1] / ($(".thumbBox").height() / 100 * 2)) + 'px',
					'background-repeat': 'no-repeat'
				});
				$('#avatar_small').css({
					'background-image': 'url(' + cropper.image.src + ')',
					'background-size': (imgData[2] / ($(".thumbBox").height() / 100 * 5)) + 'px ' + (imgData[3] / ($(".thumbBox").height() / 100 * 5)) + 'px',
					'background-position': (imgData[0] / ($(".thumbBox").height() / 100 * 5)) + 'px ' + (imgData[1] / ($(".thumbBox").height() / 100 * 5)) + 'px',
					'background-repeat': 'no-repeat'
				});
			}
		}
	}
	$('#btnZoomIn').on('click', function() {
		_sliderValue = winSlider.getValue();
		if(_sliderValue < 200) {
			cropper.zoomIn();
			cropit();
			$("#btnZoomOut").css("background-color","#ffa84b");
		} else {
			$("#btnZoomIn").css("background-color","rgb(230, 230, 230)");
		}
	});
	$('#btnZoomOut').on('click', function() {
		_sliderValue = winSlider.getValue();
		if(_sliderValue > 0) {
			cropper.zoomOut();
			cropit();
			$("#btnZoomIn").css("background-color","#ffa84b");
		} else {
			$("#btnZoomOut").css("background-color","rgb(230, 230, 230)");
		}
	});

	/**  SLIDER  **/
	var winSlider = new neverModules.modules.slider({
	  targetId: "slider",
	  sliderCss: "line",
	  barCss: "slider-thumb",
	  min: 0,
	  max: 200
	});
	winSlider.onstart  = function () {}
	winSlider.onchange = function () {}
	winSlider.onfinish = function () {}
	$("#imageBox").dblclick(function() {
		$("#fileField").val("");
		window.cropper.state = {};
		$("#upload_avatar").click();
	});
	$(window).on("mouseup", cropit);
	/**  SETTING  **/
	if($("#mm_cog_sex").data("sex") == 0) {
		$("#mm_cog_sex").html("女");
		$("#mm_modi_sex").val("女");
	} else if($("#mm_cog_sex").data("sex") == 1) {
		$("#mm_cog_sex").html("男");
		$("#mm_modi_sex").val("男");
	} else{
		$("#mm_cog_sex").html("男女不明,莫非?");
		$("#mm_modi_sex").val("女");
	}
	$("#mm_personal_modify").click(function() {
		$("#mm_cog_personal").css("display","none");
		$("#mm_cog_personal_modify").css("display","block");
		if($("#mm_modi_des").data("des") != "") {
			$("#mm_modi_des").val($("#mm_modi_des").data("des"));
		}
	});
	$("#mm_email_amend").on("click",function(){
		$("#mm_captcha").focus();
		$("#confirm").show();
		$(".footer1").show();
		$(".footer1 input").val("");
		$(".footer2 input").val("");
		$(".footer2").show();
	});

	$("#close").on("click",function(){
		$(this).parents(".box").hide();
	});
	$("#btn_ok").on("click",function() {
		var that=$(this);
		var data=$("#mm_captcha").val();
		$.ajax({
			type:"POST",
			url:"http://profile.mengma.com/api/setting/checkverify",
			data:{"captcha":data},
			success:function(data){
				if(data["code"] == "0"){
					that.parents(".footer1").hide()
				}else{
					that.prev().prev().prev().show();
					$("#mm_img_captcha").attr("src","http://profile.mengma.com/api/setting/captcha")
				}
			}
		})
	});
	$("#btn_sendEmail").on("click",function(){
		$("#mm_my_email").val($(this).prev().val())
		var reg = /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
		var str=$(this).prev().val();
		var that=$(this)
		$.ajax({
			type:"POST",
			url:"http://profile.mengma.com/api/setting/updateemail",
			data:{"email":str},
			success:function(data){
				if( reg.test(str) ){
					if(data["code"] == "0"){
						that.parents(".footer2").hide();
					}else{
						that.prev().prev().prev().show();
						that.prev().prev().hide();
					}
				}else{
					that.prev().prev().show();
					that.prev().prev().prev().hide();
				}
			}
		});
	});
   
	$("#btn_close").on("click",function(){
		$(this).parents(".box").hide();
	});
	$("#mm_cog_gomail_2").click(function() {
		var links = $("#mm_my_email").val().split("@")[1];
		window.open("http://mail." + links,'newwindow');
		$('#mm_cog_verify').modal('hide');
	});
   $("#btn_goEmail").on("click",function(){
		var links=$("#btn_sendEmail").prev().val().split("@")[1];
		console.debug(links);
		window.open('http://mail.'+ links,'newwindow');
		$('#confirm').hide();
	});
});

</script>
<a href="javascript:void(0)" id="mm_backtop"><i class="fa fa-angle-double-up"></i></a><a href="javascript:void(0)" id="mm_backtop"><i class="fa fa-angle-double-up"></i></a><div class="datetimepicker datetimepicker-dropdown dropdown-menu"><div class="datetimepicker-minutes" style="display: none;"><table class=" table-condensed"><thead><tr><th class="prev" style="visibility: visible;"><i class="fa fa-angle-double-left"></i></th><th colspan="5" class="switch">14 六月 2016</th><th class="next" style="visibility: visible;"><i class="fa fa-angle-double-right"></i></th></tr></thead><tbody><tr><td colspan="7"><span class="minute">16:00</span><span class="minute">16:05</span><span class="minute active">16:10</span><span class="minute">16:15</span><span class="minute">16:20</span><span class="minute">16:25</span><span class="minute">16:30</span><span class="minute">16:35</span><span class="minute">16:40</span><span class="minute">16:45</span><span class="minute">16:50</span><span class="minute">16:55</span></td></tr></tbody><tfoot><tr><th colspan="7" class="today" style="display: none;">今日</th></tr></tfoot></table></div><div class="datetimepicker-hours" style="display: none;"><table class=" table-condensed"><thead><tr><th class="prev" style="visibility: visible;"><i class="fa fa-angle-double-left"></i></th><th colspan="5" class="switch">14 六月 2016</th><th class="next" style="visibility: visible;"><i class="fa fa-angle-double-right"></i></th></tr></thead><tbody><tr><td colspan="7"><span class="hour">0:00</span><span class="hour">1:00</span><span class="hour">2:00</span><span class="hour">3:00</span><span class="hour">4:00</span><span class="hour">5:00</span><span class="hour">6:00</span><span class="hour">7:00</span><span class="hour">8:00</span><span class="hour">9:00</span><span class="hour">10:00</span><span class="hour">11:00</span><span class="hour">12:00</span><span class="hour">13:00</span><span class="hour">14:00</span><span class="hour">15:00</span><span class="hour active">16:00</span><span class="hour">17:00</span><span class="hour">18:00</span><span class="hour">19:00</span><span class="hour">20:00</span><span class="hour">21:00</span><span class="hour">22:00</span><span class="hour">23:00</span></td></tr></tbody><tfoot><tr><th colspan="7" class="today" style="display: none;">今日</th></tr></tfoot></table></div><div class="datetimepicker-days" style="display: block;"><table class=" table-condensed"><thead><tr><th class="prev" style="visibility: visible;"><i class="fa fa-angle-double-left"></i></th><th colspan="5" class="switch">六月 2016</th><th class="next" style="visibility: visible;"><i class="fa fa-angle-double-right"></i></th></tr><tr><th class="dow">日</th><th class="dow">一</th><th class="dow">二</th><th class="dow">三</th><th class="dow">四</th><th class="dow">五</th><th class="dow">六</th></tr></thead><tbody><tr><td class="day old">29</td><td class="day old">30</td><td class="day old">31</td><td class="day">1</td><td class="day">2</td><td class="day">3</td><td class="day">4</td></tr><tr><td class="day">5</td><td class="day">6</td><td class="day">7</td><td class="day">8</td><td class="day">9</td><td class="day">10</td><td class="day">11</td></tr><tr><td class="day">12</td><td class="day">13</td><td class="day active">14</td><td class="day">15</td><td class="day">16</td><td class="day">17</td><td class="day">18</td></tr><tr><td class="day">19</td><td class="day">20</td><td class="day">21</td><td class="day">22</td><td class="day">23</td><td class="day">24</td><td class="day">25</td></tr><tr><td class="day">26</td><td class="day">27</td><td class="day">28</td><td class="day">29</td><td class="day">30</td><td class="day new">1</td><td class="day new">2</td></tr><tr><td class="day new">3</td><td class="day new">4</td><td class="day new">5</td><td class="day new">6</td><td class="day new">7</td><td class="day new">8</td><td class="day new">9</td></tr></tbody><tfoot><tr><th colspan="7" class="today" style="display: none;">今日</th></tr></tfoot></table></div><div class="datetimepicker-months" style="display: none;"><table class="table-condensed"><thead><tr><th class="prev" style="visibility: visible;"><i class="fa fa-angle-double-left"></i></th><th colspan="5" class="switch">2016</th><th class="next" style="visibility: visible;"><i class="fa fa-angle-double-right"></i></th></tr></thead><tbody><tr><td colspan="7"><span class="month">1月</span><span class="month">2月</span><span class="month">3月</span><span class="month">4月</span><span class="month">5月</span><span class="month active">6月</span><span class="month">7月</span><span class="month">8月</span><span class="month">9月</span><span class="month">10月</span><span class="month">11月</span><span class="month">12月</span></td></tr></tbody><tfoot><tr><th colspan="7" class="today" style="display: none;">今日</th></tr></tfoot></table></div><div class="datetimepicker-years" style="display: none;"><table class="table-condensed"><thead><tr><th class="prev" style="visibility: visible;"><i class="fa fa-angle-double-left"></i></th><th colspan="5" class="switch">2010-2019</th><th class="next" style="visibility: visible;"><i class="fa fa-angle-double-right"></i></th></tr></thead><tbody><tr><td colspan="7"><span class="year old">2009</span><span class="year">2010</span><span class="year">2011</span><span class="year">2012</span><span class="year">2013</span><span class="year">2014</span><span class="year">2015</span><span class="year active">2016</span><span class="year">2017</span><span class="year">2018</span><span class="year">2019</span><span class="year old">2020</span></td></tr></tbody><tfoot><tr><th colspan="7" class="today" style="display: none;">今日</th></tr></tfoot></table></div></div></body></html>